import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
    plugins: [vue()],
    base: './',
    build: {
        outDir: '../max-core/src/main/resources/public/max-ui',
        emptyOutDir: true
    },
    server: {
        cors: true,
        proxy: {
            "^/": {
                target: "http://127.0.0.1:3001",
                changeOrigin: true,
                bypass: (req) => {
                    if (req.url.endsWith("/") || req.url.includes("@") || req.url.includes(".")) {
                        return req.url;
                    }
                }
            }
        }
    }
})
